<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 大整数
    let a=521n
    console.log(a,typeof a);

    // bigInt用于大数值的运算
    let max=Number.MAX_SAFE_INTEGER;
    // js中超过最大安全值的运算时会运算出错
    // 所以将数值转成bigInt类型进行运算
    console.log(BigInt(max)+BigInt(1));
  </script>
</body>
</html>